<?php

class Application_Model_GeneralizeParticipate extends Application_Model_DomainObject {

    protected $_id;
    /**
     * 活动Id
     */
    protected $_receiveId;
    /**
     * 规则Id
     */
    protected $_receiveType;
    /**
     * 用户Id
     */
    protected $_activityCode;
    
    public static function addParticipate($receiveId,$receiveType,$activityCode) {
        $participateItem = new Application_Model_GeneralizeParticipate();
        $participateItem->receiveId = $receiveId;
        $participateItem->receiveType = $receiveType;
        $participateItem->activityCode = $activityCode;
        $participateItem->save();
    }
    
    public static function getItemByReceiveIdAndType($receiveId,$receiveType) {
        return self::getDao()->queryOne(array("receiveId = "=>$receiveId," and receiveType = "=>$receiveType));
    }
   
}